% Generate a random number in the given intervall
% input min: the lower bound inclusive
% input max: the upper bound inclusive
% input n: n dimension for the result matrice
% input m: m dimension for the result matrice
function [y] = RandBetween(min, max, n, m)

	% necessary to include upper bound
	max = max+1;
	
	% prevent errors
	if(min > max)
		tmp = min;
		min = max;
		max = tmp;
	endif
	
	% genrate the random vector with values in the given intervall
	y = min + (max-min) * rand(n, m);
endfunction